package com.androidmarketdemo.ui;

import com.androidmarketdemo.R;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.ViewGroup.LayoutParams;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;
import android.widget.TableLayout;
import android.widget.TextView;

public class TabbedAssetBrowser extends TabActivity {

	TabHost mTabHost;
	LayoutInflater mLayoutInflater;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.asset_browser_tab);
		mLayoutInflater = (LayoutInflater)getSystemService("layout_inflater");
		mTabHost = getTabHost();
		
		TabSpec tabSpec = mTabHost.newTabSpec("recommend");
		tabSpec.setContent(new Intent().setClass(this, CommonAppListActivity.class));
		TextView tabText = (TextView) mLayoutInflater.inflate(R.layout.tab_indicator, null);
		tabText.setBackgroundResource(R.drawable.top_represent);
		tabText.getBackground().setCallback(null);
		tabText.setText(getString(R.string.recommend));
		tabText.setTextSize(18.0f);
		tabText.setLayoutParams(new TableLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT, 1.0f));
		tabSpec.setIndicator(tabText);
		mTabHost.addTab(tabSpec);
		
		// mTabHost.addTab(tabSpec);
		
		//mTabHost.addTab(tabSpec);
	}

}
